package com.big.app.controller;

import com.big.app.entity.Cheats;
import com.big.app.service.intf.CheatsService;
import com.big.app.vo1.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@CrossOrigin// 跨域
@Api(value = "用户注册操作",tags = "用户注册操作")
public class CheatsController {
    @Autowired
    private CheatsService service;

    @RequestMapping("/api/cheat.do")
    @ResponseBody
    public R a(@RequestBody Cheats cheats){
        String cheaturl = cheats.getCheaturl();
        R r = service.all(cheaturl);
        System.out.println(r);
        return r;
    }

    @RequestMapping("/api/plinsert.do")
    @ResponseBody
    public R b(@RequestBody Cheats cheats){
        //String cheaturl = cheats.getCheaturl();
        R r = service.insert(cheats);
        System.out.println(r);
        return r;
    }

}
